package com.itheima.mall.service.pmsService;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.pojo.pms.PmsProductCategory;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class PmsProductCategoryService {

    @DubboReference
    private PmsProductCategoryApi productCategoryApi;


    public void save(PmsProductCategory pmsProductCategory) {
        productCategoryApi.create(pmsProductCategory);
    }

    public void removeById(Long id) {
        productCategoryApi.removeById(id);
    }

    public void update(PmsProductCategory pmsProductCategory) {
        productCategoryApi.update(pmsProductCategory);
    }

    public List<PmsProductCategory> withChildren(LambdaQueryWrapper<PmsProductCategory> wrapper) {
        return productCategoryApi.withChildren(wrapper);
    }

    public Page<PmsProductCategory> page(Page<PmsProductCategory> pageInfo, LambdaQueryWrapper<PmsProductCategory> wrapper) {
        return productCategoryApi.page(pageInfo,wrapper);
    }

    public List<PmsProductCategory> selectByIds(List<Long> ids) {
        return productCategoryApi.selectByIds(ids);
    }

    public void updateById(List<PmsProductCategory> categoryList) {
        productCategoryApi.updateById(categoryList);
    }

    public PmsProductCategory selectByid(Long id) {
        return productCategoryApi.selectById(id);
    }
}
